package model

import (
	"fmt"
	"gorm.io/gorm"
	."gitee.com/edgebox/pkg/db"
)
var sqldb *gorm.DB
func ModelInit() {
	sqldb = GetDB()
	if sqldb != nil{
		sqldb.AutoMigrate(
			&Module{},
			&Item{},
			&Export{},
			&App{},
			&Net{},
			&KeyPair{},
			&Frp{},
		)
		init_global()
	}else{
		fmt.Println("db is nil")
	}
}
func InitApp() {
	init_app()
}